<template>
  <!-- 对话框(添加 / 修改) -->
  <el-dialog
    :title="title"
    :visible.sync="show"
    width="500px"
    append-to-body
    :before-close="cancel"
    :close-on-click-modal="false"
  >
    <el-form
      disabled
      ref="form"
      :model="form"
      :rules="rules"
      label-width="80px"
    >
      <el-form-item label="评价项目" prop="evaluationItem">
        <el-input v-model="form.evaluationItem" />
      </el-form-item>
      <el-form-item label="评价内容" prop="evaluationText">
        <el-input v-model="form.evaluationText" />
      </el-form-item>
    </el-form>
  </el-dialog>
</template>

<script>
import { createEvaluationItem, updateEvaluationItem } from "@/api/study/evaluationItem";

export default {
  name: "EvaluationItemView",
  components: {
  },
  data() {
    return {
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() { },
  props: {
    // 是否显示弹出层
    show: {
      type: Boolean,
      default: false
    },
    // 显示弹出层标题
    title: {
      type: String,
      default: ''
    }
  },
  methods: {
    /** 初始化编辑的数据**/
    initData(rowData) {
      this.reset();
      if (rowData && rowData.id) {
        this.form = rowData;
        this.form.datetimerange = [this.form.startTime, this.form.endTime]
      }
    },
    /** 取消按钮 */
    cancel() {
      this.$emit('update:show', false)
      this.reset();
    },
    /** 表单重置 */
    reset() {
      this.form = {
        id: undefined,
        evaluationItem: undefined,
        evaluationText: undefined,
        remark: undefined,
        orgId: undefined,
      };
      this.resetForm("form");
    },

  }
};
</script>
